P32A 001000 |
rt |
rs |
ac |
MAQ_S.W.PHR 0 |
0 |
101 |
001 |
111 |
111 |
P32A 001000 |
rt |
rs |
ac |
MAQ_SA.W.PHR 1 |
0 |
101 |
001 |
111 |
111 |
6 |
5 |
5 |
2 |
1 |
1 |
3 |
3 |
3 |
3 |
MAQ_S[A].W.PHR |
Multiply with Accumulate Single Vector Fractional Halfword Element | |
MAQ_S.W.PHR ac, rs, rt |
DSP |
Multiply with Accumulate Single Vector Fractional Halfword Element |
MAQ_SA.W.PHR ac, rs, rt |
DSP |
Multiply with Accumulate Single Vector Fractional Halfword Element |
Multiply with Accumulate Single Vector Fractional Halfword Element
To multiply one pair of elements from two vectors of fractional halfword values using full-sized intermediate products and accumulate the result into the specified 64-bit accumulator, with optional saturating accumulation.
ac = sat32(ac + sat32(rs15..0 * rt15..0))
The right-most Q15 fr actional halfword values from each of the re gisters rt and rs are multiplied together and the product left-shifted by one bit position to generate a Q31 fractional format intermediate result. If both multiplicands are equal to -1.0 in Q15 fractional format (0x8000 hexadecimal), the intermediate result is saturated to the maximum positive Q31 fractional value (0x7FFFFFFF hexadecimal). The intermediate result is then sign-extended and accumulated into accumulator ac to generate a 64-bit Q32.31 fractional format result.
In the saturating accumulation variant of this instruction, if the accumulati on of the intermediate product with the accumulator results in a value that cannot be represented as a Q31 fractional format value, the accumulator is saturated to either the maximum positive Q31 fractional format value (0x7FFFFFFF hexadecimal) or the minimum negative Q31 fractional format value (0x80000000), sign-extended to 64 bits.
The value of ac can range from 0 to 3; a v alue of 0 refers to the original HI/LO register pair of the MIPS32 architecture.
If overflow or saturation occurs, a 1 is wri tten to one of bits 16 through 19 of the DSPControl register, within the
ouflag field. The value of ac determines which of these bits is set: bit 16 corresponds to ac0, bit 17 to ac1, bit 18 to ac2, and bit 19 to ac3.
No data-dependent exceptions are possible.
The operands must be values in the specified format. If they are not, the result is UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.
MAQ_S.W.PHR ValidateAccessToDSPResources() tempA31..0 = multiplyQ15Q15( ac, GPR[rs]15..0, GPR[rt]15..0 ) tempB63..0 = ( HI[ac]31..0 || LO[ac]31..0 ) + ( (tempA31)32 || tempA31..0 ) ( HI[ac]31..0 || LO[ac]31..0 ) = tempB63..32 || tempB31..0 MAQ_SA.W.PHR ValidateAccessToDSPResources() tempA31..0 = multiplyQ15Q15( ac, GPR[rs]15..0, GPR[rt]15..0 ) tempA31..0 = sat32AccumulateQ31( ac, temp ) tempB63..0 = (tempA31)32 || tempA31..0
Reserved Instruction, DSP Disabled
The MAQ_SA version of the instruction is useful for compliance with some ITU speech processing codecs that require a 32-bit saturation after every multiply-accumulate operation.